package com.open.capacity.notice.context;

import java.util.List;

import org.springframework.util.Assert;
import com.open.capacity.notice.dmo.MessageTemplate;
import com.open.capacity.notice.dmo.SendMessageJob;
import com.open.capacity.notice.dmo.SendMessageTask;
import com.open.capacity.notice.validator.JobChecker;
import com.open.capacity.notice.validator.SmsChecker;
import com.open.capacity.notice.validator.TemplateChecker;
import com.open.capacity.notice.validator.WechatChecker;
import com.open.capacity.notice.vo.MessageRececiverGroupVO;

import lombok.Data;
import net.bytebuddy.matcher.ElementMatchers;

@Data
@SuppressWarnings("all")
public class SendMessageJobContext {

	private SendMessageJob sendMessageJob;

	private MessageTemplate messageTemplate;

	private MessageRececiverGroupVO messageRececiverGroupVO;

	private List<SendMessageTask> sendMessageTasks;

	private String msg;

	public void validate() {
		boolean flag = ElementMatchers.any().and(JobChecker.getInstance()).and(TemplateChecker.getInstance())
				.and(SmsChecker.getInstance()).and(WechatChecker.getInstance()).matches(this);
		Assert.isTrue(flag, this.msg);
	}

}
